package glen.util;

import org.apache.ibatis.exceptions.PersistenceException;

import java.util.List;

public interface ITemplateDAO<T, PK> {
    public T get(PK id) throws PersistenceException;//get obj of type T by the primary key 'id'

    public List<T> search(T objInstance) throws PersistenceException;//get obj of type T by the 'name' field, if one exists for that table

    public int create(T objInstance) throws PersistenceException;//insert an object of type T into the database

    int update(T transientObject) throws PersistenceException; //update an object of type T

    int delete(PK id) throws PersistenceException;//delete an object of type T

}
